﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="tm_Message.ascx.cs" Inherits="controls_tm_Message" %>
<%@ Register Src="tm_MessageSearch.ascx" TagName="tm_MessageSearch" TagPrefix="uc3" %>
<%@ Register Src="tm_SendMessage.ascx" TagName="tm_SendMessage" TagPrefix="uc2" %>
<%@ Register Src="tm_UploadFile.ascx" TagName="tm_UploadFile" TagPrefix="uc1" %>
<div id="body_orange1">
    <table border="0" width="100%">
        <tr>
            <td style="width: 150px">
                <asp:LinkButton ID="btnInComingMsg" runat="server" OnClick="btnInComingMsg_Click">Thông điệp đến</asp:LinkButton><asp:Label
                    ID="lblInComingQty" runat="server"></asp:Label></td>
            <td style="width: 150px">
                <asp:LinkButton ID="btnOutGoingMsg" runat="server" OnClick="btnOutGoingMsg_Click">Thông điệp đi</asp:LinkButton><asp:Label
                    ID="lblOutGoingQty" runat="server"></asp:Label></td>
            <td style="width: 150px">
                <asp:LinkButton ID="btnSearch" runat="server" OnClick="btnSearch_Click">Tìm kiếm</asp:LinkButton></td>
            <td>
                <asp:LinkButton ID="btnAddNew" runat="server" OnClick="btnAddNew_Click">Thêm mới</asp:LinkButton></td>
        </tr>
    </table>
    <table width="100%">
        <tr>
            <td>
                <asp:Panel ID="pnlMessage" runat="server" >
                    <div>
                        <table width="100%">
                            <tr>
                                <td colspan="2">
                     <asp:GridView ID="gvMessage" runat="server" AllowPaging="True"
                    AutoGenerateColumns="False" CssClass="table" OnPageIndexChanging="gvMessage_PageIndexChanging"
                      Width="100%">
                    <Columns>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:CheckBox ID="chkItem" runat="server" /><asp:Label ID="lblMessageId" runat="server"
                                    Text='<%# DataBinder.Eval(Container, "DataItem.MessageId") %>' Visible="False"></asp:Label>
                                <asp:Label ID="lblMySpaceId" runat="server" Text='<%# Eval("mySpaceId") %>' Visible="False"></asp:Label>
                            </ItemTemplate>
                            <ItemStyle Width="20px" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Chủ đề" SortExpression="msgSubject">
                            <ItemTemplate>
                                <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# GetMessageURL(DataBinder.Eval(Container, "DataItem.MessageId").ToString(),DataBinder.Eval(Container, "DataItem.mySpaceId").ToString())%>'><%# DataBinder.Eval(Container, "DataItem.msgSubject").ToString()%></asp:HyperLink>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Ng&#224;y" SortExpression="onDate">
                            <ItemStyle HorizontalAlign="Center" Width="100px" />
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# ((DateTime)DataBinder.Eval(Container, "DataItem.onDate")).ToShortDateString() %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Người gửi" SortExpression="getFullName">
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("getFullname") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="Label2" runat="server" Text='<%# GetFullname(Eval("getFullname").ToString()) %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Người nhận" SortExpression="getFullName">
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("getFullname") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="Label3" runat="server" Text='<%# GetFullname(Eval("getFullname").ToString()) %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="SenderId" HeaderText="Send" Visible="False" />
                        <asp:BoundField DataField="ReceiverId" HeaderText="Rec" Visible="False" />
                    </Columns>
                    <PagerSettings Mode="NumericFirstLast" />
                    <PagerStyle HorizontalAlign="Right" />
                </asp:GridView>
                                </td>
                            </tr>
                            <tr>
                                <td>
                    <asp:Label ID="lblDeleteNotice" runat="server" Visible="False"></asp:Label>    
                    <asp:CheckBox ID="chkCheckAll" runat="server" AutoPostBack="True" CssClass="titletext3"
                        OnCheckedChanged="chkCheckAll_CheckedChanged" Text="Chọn tất cả" Visible="False" /></td>
                                <td align="right">
                                    <asp:Button ID="btnMsgDelete" runat="server" CssClass="btn" OnClick="btnMsgDelete_Click"
                                        Text="Xóa chọn" Visible="False" style="height: 26px" /></td>
                            </tr>
                        </table>
                </div>
                <div align="left">
                    
                </div>
                </asp:Panel>
                
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;<uc2:tm_SendMessage ID="Tm_SendMessage" runat="server"
                    Visible="false" />
            </td>
        </tr>
        <tr>
            <td align="center">
                <uc3:tm_MessageSearch ID="Tm_MessageSearch" runat="server" Visible="false" />
            </td>
        </tr>
        <tr>
            <td align="center">
                <asp:Button ID="btnReply" runat="server" OnClick="btnReply_Click" Text="Trả lời"
                    Visible="False" CssClass="btn" /></td>
        </tr>
        
    </table>
    
</div>
